home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / dos / teachaid / babydos / chapt3 < prev    next >
Text File  |  1994-06-08  |  10KB  |  330 lines

  1.  
  2.  
  3.                             CHAPTER 3
  4.  
  5.                         COLOR COMBINATIONS
  6.  
  7.         In This Chapter You Will Learn:
  8.         To Write 64 color combinations
  9.         Experiment with 1 and 2-letter color codes
  10.         Create A Color Menu
  11.  
  12.   └─  WRITING YOUR OWN COLOR COMBINATIONS
  13.         There are 8 colors that you will be using for the
  14.         foreground (for letters) and eight for the background.
  15.         This gives you 64 combinations from which to select your
  16.         favorite colors.
  17.  
  18.         One approach to writing these codes is to use a simple
  19.         formula for a set of 8 background colors and a set of 8
  20.         foreground (letters). This is easily done by using the first
  21.         letter of each color: for example, R for red letters, and
  22.         RB for red background. This code will also serve as the
  23.         name of the Batch file.
  24.  
  25.   
  26.    └─  A SPEED COURSE IN INSTANT COLOR
  27.         The Batch Files that you will be writing have been
  28.         designed by the Author to change foreground or background
  29.         color individually or together.
  30.  
  31.         The Batch Files that you write will contain the commands
  32.         Echo Off and Clear Screen (Cls). Other information about the
  33.         Batch File is described below.
  34.         ▀  The Echo off command will prevent the  codes from
  35.         appearing on the screen.
  36.  
  37.         ▀  The Clear command will then clear the Echo Off
  38.           command from the screen.
  39.  
  40.         ▀  When you enter a Letter command on the keyboard and
  41.            press Enter, the Prompt and text will appear in that color.
  42.  
  43.         ▀  When you enter a Background command, the screen
  44.            color will change.
  45.  
  46.         ▀  When you enter a letter (Y) and a background color
  47.            (BB) the screen will show both color changes
  48.            simultaneously.
  49.  
  50.         ▀  Each Batch File will contain a "Variable Parameter
  51.            <%1>". This will make the Batch File accept another
  52.            Batch File.  This is how you can have the two colors
  53.            change at the same time.
  54.  
  55.         ▀   The Directory command "DIR" will be included each Batch
  56.             File. Since this is the last command in each Bat file it will
  57.             provide text material to view with the color changes.
  58.  
  59.             Note the second item in each Batch file uses the variable %1.
  60.             This is where the second Batch file is activated
  61.             (executes).
  62.  
  63.                                   -9-
  64.  
  65.  
  66.  
  67.  
  68.             For example, if you want yellow letters and blue background, the
  69.             yellow letters execute first, then the blue background executes
  70.             second from the variable %1.
  71.  
  72.         By using a variable you can substitute any color for %1. In
  73.         the case above you could replace the blue background with any
  74.         of the eight colors.
  75.  
  76.         The last item in each Bat file is the Directory command "DIR.
  77.         This means whichever Batch file you use the program
  78.         will always end with a display on the screen of the files
  79.         in the directory.
  80.  
  81.  
  82.    └─  PUTTING COLOR CODES INTO A MENU
  83.         Another way to check color is to put the list of color codes
  84.         into a 2-letter Menu. Each time you make a color selection,
  85.         you can return to the Menu by entering 2L.  This will give you
  86.         some color to look at while making your next selection.
  87.  
  88.  
  89.   └─  HOW TO WRITE THE 2L MENU APPEARS BELOW.
  90.        ▀  The Menu is Written Like This:
  91.         Type next to the A> prompt the following, like this:
  92.  
  93.         Copy Con 2L.Bat
  94.         Prompt $p$g
  95.         Echo off
  96.         Cls
  97.         Echo:====== 1 and 2-Letter Color Codes ======
  98.         Echo:
  99.         Echo:  Select 1 color from either column, or 2 colors,
  100.         Echo:  1 for Letters and 1 for Background
  101.         Echo:       Then Press Enter Key
  102.         Echo:
  103.         Echo:   R...Red letters        RB... Red background
  104.         Echo:   G...Green letters      GB...Green background
  105.         Echo:   Y...Yellow letters     YB..Yellow background
  106.         Echo:
  107.         Echo:   B...Blue letters       BB...Blue background
  108.         Echo:   M...Magenta letters    MB.Magenta background
  109.         Echo:   CY..Cyan letters       CB...Cyan background
  110.         Echo:
  111.         Echo:   W...White letters      WB...White background
  112.         Echo:   BLK..Black letters     BLB..Black background
  113.         Echo:============================
  114.         Press F6 key, then press Enter key to finish Batch file.
  115.         ---------
  116.         You have completed the 2L Menu Bat File.
  117.         It will be used in all the color Bat files. When a color
  118.         appears on the screen it will always display the 2L Menu.
  119.  
  120.    └─  COLOR CODES
  121.         The next lessons use many of the DOS commands that you
  122.         have learned thus far. The Batch files contain a good
  123.         variety of color codes, parameters, and DOS
  124.         commands. You will enjoy how fast these Speed keys operate.
  125.  
  126.  
  127.  
  128.                                   -10-
  129.  
  130.  
  131.  
  132.  
  133.    └─  WRITING THE COLOR CODE BAT FILES
  134.         We'll Start With the Background Colors.
  135.         Type the following next to the A> Prompt,
  136.         Like this:          <Press Enter Key after each line.>
  137.  
  138.                 Copy Con BLB.Bat     (Black background)*
  139.                 Prompt $e[40m $p$g
  140.                 %1
  141.                 Echo off
  142.                 Cls
  143.                 2L.Bat
  144.                 Press F6 key, then press Enter key.
  145. ----------------
  146.  
  147.                 Copy Con RB.Bat            (Red background)
  148.                 Prompt $e[41m  $p$g
  149.                 %1
  150.                 Echo off
  151.                 Cls
  152.                 2L.Bat
  153.                 Press F6 key, then press Enter key.
  154. ----------------
  155.  
  156.                 Copy Con GB.Bat       (Green background)
  157.                 Prompt $e[42m  $p$g
  158.                 %1
  159.                 Echo off
  160.                 Cls
  161.                 2L.Bat
  162.                 Press F6 key, then press Enter key.
  163. --------------
  164.  
  165.                 Copy Con YB.Bat         (Yellow background)
  166.                 Prompt $e[43m  $p$g
  167.                 %1
  168.                 Echo off
  169.                 Cls
  170.                 2L.Bat
  171.                 Press F6 key, then press Enter key.
  172. --------------
  173.  
  174.                 Copy Con BB.Bat         (Blue background)
  175.                 Prompt $e[44m  $p$g
  176.                 %1
  177.                 Echo off
  178.                 Cls
  179.                 2L.Bat
  180.                 Press F6 key, then presss Enter key.
  181. ---------------                                               
  182.                                                  
  183.  
  184.                 Copy Con MB.Bat     (Magenta background)
  185.                 Prompt $e[45m  $p$g
  186.                 %1
  187.                 Echo off
  188.                 Cls
  189.                 2L.Bat
  190.                 Press F6 key, then press Enter key.
  191. ----------------
  192.  
  193.                                   -11-
  194.  
  195.  
  196.  
  197.  
  198.                 Copy Con CB.Bat       (Cyan background>
  199.                 Prompt $e[46m  $p$g
  200.                 %1
  201.                 Echo off
  202.                 Cls
  203.                 2L.Bat
  204.                 Press F6 key, then press Enter key.
  205. ---------------
  206.                                                    
  207.                 Copy Con WB.Bat       (White background)
  208.                 Prompt $e[47m  $p$g
  209.                 %1
  210.                 Echo off
  211.                 Cls
  212.                 2L.Bat
  213.                 Press F6 key, the press Enter key.
  214. *=*=*=*=*-*-*-*-*
  215.                                       
  216. In The Next Group Are The Codes For The Letters (Foreground).
  217.  
  218.                 Copy Con BLK.BAT           (Black letters)
  219.                 Prompt $e[30m  $p$g
  220.                 %1
  221.                 Echo off
  222.                 Cls
  223.                 2L.Bat
  224.                 Press F6 key, the press Enter key.
  225. --------------
  226.  
  227.                 Copy Con R.Bat           (Red letters)
  228.                 Prompt $e[1;31m  $p$g
  229.                 %1
  230.                 Echo off
  231.                 Cls
  232.                 2L.Bat
  233.                 Press F6 key, then press Enter key.
  234. --------------
  235.  
  236.                 Copy Con G.Bat           (Green letters)
  237.                 Prompt $e[1;32m  $p$g
  238.                 %1
  239.                 Echo off
  240.                 Cls
  241.                 2L.Bat
  242.                 Press F6 key, then press Enter key.
  243. ---------------
  244.  
  245.                 Copy Con Y.Bat            (Yellow letters)
  246.                 Prompt $e[1;33m  $p$g
  247.                 %1
  248.                 Echo off
  249.                 Cls
  250.                 2L.Bat
  251.                 Press F6 key, then press Enter key.
  252. ----------------
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                   -12-
  262.  
  263.  
  264.  
  265.  
  266.  
  267.                 Copy Con B.Bat            (Blue letters)
  268.                 Prompt $e[1;34m  $p$g
  269.                 %1
  270.                 Echo off
  271.                 Cls
  272.                 2L.Bat
  273.                 Press F6 key, then press Enter key.
  274. ----------------
  275.  
  276.                 Copy Con M.Bat            (Magenta letters)
  277.                 Prompt $e[1;35m  $p$g
  278.                 %1
  279.                 Echo off
  280.                 Cls
  281.                 2L.Bat
  282.                 Press F6 key, then press Enter key.
  283. ----------------
  284.                                               
  285.                 Copy Con CY.Bat             (Cyan letters)
  286.                 Prompt $e[1;36m  $p$g
  287.                 %1
  288.                 Echo off
  289.                 Cls
  290.                 2L.Bat
  291.                 Press F6 key, then press Enter key.
  292. --------------
  293.  
  294.                 Copy Con W.Bat         (White  letters)
  295.                 Prompt $e[1;37m  $p$g
  296.                 %1
  297.                 Echo off
  298.                 Cls
  299.                 2L.Bat
  300.                 Press F6 key, then press Enter key.
  301. --------------
  302.  
  303.         This ends the writing of Batch Files for the 1 and 2 letter
  304.         color-codes.
  305.  
  306.                      *** END OF CHAPTER ***
  307.  
  308.                Press <ESC> key to return to Menu.
  309.  
  310.              Select "Chapter 4" ...Testing Colors.
  311.  
  312.                  Then Press <Enter> key.
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                   -13-
  329.  
  330.